<%@page language="java" contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
input {
	border-top-right-radius: 5px;
	border-top-left-radius: 5px;
	border-bottom-left-radius: 5px;
	border-bottom-right-radius: 5px;
}

.div3 {
	border-top-right-radius: 30px;
	border-top-left-radius: 30px;
	border-bottom-left-radius: 30px;
	border-bottom-right-radius: 30px;
	height: 500px;
	float: left;
	font-size: 20px;
	background-color: rgba(150, 0, 0, 0.2);
	width: 39%;
	margin-left: 250px
}

p {
	height: 30px;
	line-height: 200px;
}
</style>
<script type="text/javaScript">
	function test(form) {
		var realvalue = form.real.value;
		var classvalue = form.stuclass.value;
		var classt = /^2016[0-1][0-9]$/;
		var uservalue = form.user.value;
		var usert = /^\w{6,10}|\d{6,10}$/;
		var passvalue = form.passw.value;
		var passt = /^\d{6,}$/;
		if (uservalue == "") {
			alert("用户名不能为空！");
			document.getElementById('user').focus();
			return false;
		}
		var ut = usert.test(uservalue);
		var pt = passt.test(passvalue);
		var ct = classt.test(classvalue);
		if (!ut) {
			alert("用户名必须为字母或数字并且在6个到10个之间！");
			document.getElementById('user').focus();
			return false;
		}
		if (passvalue!=""&&!pt) {
			alert("密码必须为数字并且不少于6个！");
			document.getElementById('user').focus();
			return false;
		}
		if (classvalue!=""&&!ct) {
			alert("班级必须为六位数字且前四位必须为2016,第五位不大于1！");
			document.getElementById('user').focus();
			return false;
		}
		return true;
	}
	function succ() {
		var suc = ${requestScope.success};
		if (suc == "1") {
			alert("修改失败！");
		}
		if (suc == '2') {
			alert("修改成功！");
		}
		document.getElementById('user').focus();
	}
</script>
</head>
<body background="pic/5-13050GZ015.gif" onload="succ()">
	<p>欢迎 ${sessionScope.adm.realName }</p>
	<div align="center">
		<img src="pic/a3cc7cd98d1001e9c7ad571eb00e7bec54e7970a.jpg" alt="Dory">
	</div>
	<div
		style="font-size: 20px; float: left; background-image: url(pic/u=4209667892,382162925&amp;amp;fm=21&amp;amp;gp=0.jpg); width: 293px; height: 190px; padding-top: 30px; border-top-right-radius: 10px; border-top-left-radius: 10px; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
		<ul type="square" style="height: 20px; line-height: 20px;">
			待办事项
			<li><a href="UpPassServlet">修改密码</a></li>
			<li><a href="InsertStudentServlet">添加学生</a></li>
			<li><a href="UpdateStuServlet">修改学生信息</a></li>
			<li><a href="">删除学生</a></li>
		</ul>
	</div>
	<form action="UpdateStudentServlet" method="post" onsubmit="return test(this)">
		<div class="div3" align="center">
			按学生用户名查找学生，修改学生信息
			<p>
				用&nbsp&nbsp户&nbsp&nbsp名：<input type="text" name="user" id="user"
					style="width: 300px; height: 20px;">
			</p>
			<p>
				学生姓名：<input type="text" name="real" id="real"
					style="width: 300px; height: 20px;">
			</p>
			<p>
				班&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp级：<input type="text"
					name="stuclass" style="width: 300px; height: 20px;">
			</p>
			<p>
				初始密码：<input type="password" name="passw"
					style="width: 300px; height: 20px;">
			</p>
			<p>
				<input type="submit" value="确认" style="width: 50px; height: 30px;">
				<input type="reset" value="取消" style="width: 50px; height: 30px;"
					onclick="document.getElementById('user').focus();">
			</p>
		</div>
	</form>
	<div style="width: 30%; height: 500px; float: left;">
		<img src="pic/wsj2015-3.png" alt="HalloWeen">
	</div>
</body>
</html>